.voice {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 100px;
  margin-bottom: 40px;

  ._status {
    width: 186px;
    height: 36px;
    opacity: 1;

    background: linear-gradient(270deg, #71baff 4%, #7347ff 27%, #71baff 100%);
  }

  ._dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #000;
  }

  ._box {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
  }

  ._avatar {
    width: 140px;
    height: 140px;
    position: absolute;
    top: 5px;
    left: -70px;
    border-radius: 70px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  ._agent-status {
    position: relative;
    width: 198px;
    height: 36px;
    overflow: hidden;
  }
}

._agent-status-with-avatar {
  position: relative;
  height: 0;
  width: 0;

  & > div {
    position: absolute;
    background-color: #e5e5e5;
    width: 160px;
    height: 160px;
    transform-origin: 50% 50%;
    bottom: -75px;
    left: -80px;
    border-radius: 50%;
    opacity: 1;
    background-image: url('');
    background-color: transparent;
    background-size: 100% 100%;
    animation: status-saying 2s infinite linear;
  }
}

@keyframes status-saying {
  0% {
    transform: rotate(0);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes status-thinking {
  0% {
    transform: scale(4.8);
  }
  20% {
    transform: scale(6.4);
  }
  40% {
    transform: scale(4.8);
  }
  100% {
    transform: scale(4.8);
  }
}

@keyframes status-talking {
  0% {
    height: 10px;
  }
  50% {
    height: 45px;
  }
  100% {
    height: 10px;
  }
}

@keyframes user-status-talking {
  0% {
    height: 8px;
  }
  50% {
    height: 25px;
  }
  100% {
    height: 8px;
  }
}

.voice-user-status {
  display: none;
  position: absolute;
  bottom: -55px;
  left: 50%;
  height: 64px;
  transform: translateX(-50%);
  align-items: flex-end;

  &._is-talking {
    display: flex;
  }

  & > div {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #e5e5e5;
    border-radius: 4px;
    animation: user-status-talking 400ms infinite ease-in-out;

    &:nth-child(1) {
      animation-delay: 0.1s;
      animation-duration: 474ms;
    }
    &:nth-child(2) {
      animation-delay: 0.025s;
      animation-duration: 433ms;
    }
    &:nth-child(3) {
      animation-delay: -0.05s;
      animation-duration: 407ms;
    }
    &:nth-child(4) {
      animation-delay: -0.125s;
      animation-duration: 458ms;
    }
    &:nth-child(5) {
      animation-delay: -0.2s;
      animation-duration: 400ms;
    }
    &:nth-child(6) {
      animation-delay: -0.125s;
      animation-duration: 427ms;
    }
    &:nth-child(7) {
      animation-delay: -0.05s;
      animation-duration: 441ms;
    }
    &:nth-child(8) {
      animation-delay: 0.025s;
      animation-duration: 419ms;
    }
    &:nth-child(9) {
      animation-delay: 0.1s;
      animation-duration: 487ms;
    }
  }
}

@media screen and (max-width: 768px) {
  .voice {
    margin-top: 0;
  }
}
